package com.example.demo.utils;

import java.lang.reflect.Array;

/**
 * @author zhangbiao
 * @date 2020/6/25 8:22
 * @desc 描述
 */
public class StringUtils {

    public static <T> boolean isNotEmpty(T[] array) {
        return !isEmpty(array);
    }

    public static boolean isEmpty(Object[] array) {
        return getLength(array) == 0;
    }

    public static boolean isEmpty(String str) {
        return str==null || str.length()==0;
    }

    public static int getLength(Object array) {
        return array == null ? 0 : Array.getLength(array);
    }

}
